package com.example.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.jws.WebService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sun.net.httpserver.HttpServer;


@WebServlet("/register")
public class RegisterServlet extends HttpServlet{

      @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    	// TODO Auto-generated method stub
    	String username=req.getParameter("username");
    	String password=req.getParameter("password");
    	String repassword=req.getParameter("password");
    	String email=req.getParameter("email");
    	String iphone=req.getParameter("iphone");
    	String birthday=req.getParameter("birthday");
    	String sex=req.getParameter("sex");
    	String fancy=req.getParameter("fancy");
    	String jianjie=req.getParameter("jianjie");
    	
    	PrintWriter pw = resp.getWriter();
    	
        if(username==null) {
        	pw.write("username Cannot be empty");
        }
        else if (password==null) {
        	pw.write("password Cannot be empty");
		}
        else if (repassword==null) {
        	pw.write("repassword Cannot be empty");
		}
        else if (email==null) {
        	pw.write("email Cannot be empty");
		}
        else if (iphone==null) {
        	pw.write("iphone Cannot be empty");
		}
        else if (birthday==null) {
        	pw.write("birthday Cannot be empty");
		}
        else if (sex==null) {
        	pw.write("sex Cannot be empty");
		}
        else if (fancy==null) {
        	pw.write("fancy Cannot be empty");
		}
        else if (jianjie==null) {
        	pw.write("jianjie Cannot be empty");
		}
        
        else {
			pw.write("register ok");
		}
        
    }
 
	
}
